package com.my.sys.service.impl;

import com.my.sys.model.SysRole;
import com.my.sys.repository.SysRoleRepository;
import com.my.sys.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 80002023 on 2016/5/5.
 */
@Service
public class SysRoleServiceImpl implements SysRoleService {

    @Autowired
    private SysRoleRepository sysRoleRepository;

    public SysRole save(SysRole record) {
        return sysRoleRepository.save(record);
    }

    public SysRole update(SysRole record) {
        return sysRoleRepository.save(record);
    }

    public void delete(SysRole record) {
        sysRoleRepository.delete(record);
    }

    public SysRole findById(Long id) {
        return sysRoleRepository.findOne(id);
    }

    public void deleteById(Long id) {
        sysRoleRepository.delete(id);
    }

    public List<SysRole> findAll() {
        return sysRoleRepository.findAll();
    }
}
